<?php
    use User\Model\MeetingModel;
?>
<div class="row">
    <div class="col-lg-12">
        <section class="panel">
            <header class="panel-heading">
                会议签到配置
            </header>
            <div class="panel-body">
                <form class="form-horizontal" method="post" enctype="multipart/form-data" action="<?php echo '/User/Meeting/sign_edit?meetId=' . I('get.meetId', '', '');?>">
                    <input type="hidden" value="<?php echo I('get.meetId', '', '');?>" name="meetId" id="meetId">
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">背景视频:</label>

                        <div class="col-sm-10">
                            <?php if(!empty($sign['back_video'])){
                            echo '<video src="' . $sign['back_video'] . '" controls="controls" style="width: 200px;height: 200px;"></video>';
                            }?>
                            <input name="back_video" type="file">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">背景音乐:</label>

                        <div class="col-sm-10">
                            <?php if(!empty($sign['back_music'])){
                            echo '<audio src="' . $sign['back_music'] .'" style="width: 200px;height: 30px;" controls></audio>';
                            }?>
                            <input name="back_music" type="file">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">背景图片:</label>

                        <div class="col-sm-10">
                            <img src="{$sign['back_img']}" alt="" style="width: 200px;height: 200px;">
                            <input name="back_img" type="file">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">背景文字图片:</label>

                        <div class="col-sm-10">
                            <img src="{$sign['back_text']}" alt="" style="width: 200px;height: 200px;">
                            <input name="back_text" type="file">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">结束页图片:</label>

                        <div class="col-sm-10">
                            <img src="{$sign['end_img']}" alt="" style="width: 200px;height: 200px;">
                            <input name="end_img" type="file" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">默认祝福语:</label>

                        <div class="col-sm-6">
                            <input name="wish" type="text" class="form-control" id="wish" value="{$sign['wish']}">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-10">
                            <button class="btn btn-primary" type="submit" id="submit">提交</button>
                            <a class="btn btn-default" href="<?php echo '/User/Meeting/live?meetId=' . I('get.meetId', '', '')?>">取消</a>
                        </div>
                    </div>

                </form>
            </div>
        </section>
    </div>
</div>
<script>
    $(".need").each(function(){
        $(this).prepend("<span style='color:red'>*</span>");
    });
    var message = "{$message}";
    if(message != ''){
        alert(message);
    }
    $("#submit").click(function(){
       if($("#wish").val() == ''){
           alert("默认祝福语不能为空");
           return false;
       }else{
           $("form").submit();
       }
    });
</script>